package com.springboot.seckill.controller.dto;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @Author: HuangDekai
 * @Date: 2022/3/11 18:30
 * @Version: 1.0
 * @since: jdk11
 */
public class RegisterDTO {
    @NotBlank(message = "手机号不能为空")
    private String telphone;
    @NotBlank(message = "短信验证码不能为空")
    private String otpCode;
    @NotBlank(message = "姓名不能为空")
    private String name;

    @NotNull(message = "性别不能为空")
    private Byte gender;

    @NotNull(message = "年龄不能为空")
    @Min(value = 0, message="年龄必须大于0岁")
    @Max(value = 150, message="年龄必须小于150岁")
    private Integer age;

    @NotBlank(message = "密码不能为空")
    private String password;

    public String getOtpCode() {
        return otpCode;
    }

    public void setOtpCode(String otpCode) {
        this.otpCode = otpCode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Byte getGender() {
        return gender;
    }

    public void setGender(Byte gender) {
        this.gender = gender;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getTelphone() {
        return telphone;
    }

    public void setTelphone(String telphone) {
        this.telphone = telphone;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "RegisterDTO{" +
                "telphone='" + telphone + '\'' +
                ", otpCode='" + otpCode + '\'' +
                ", name='" + name + '\'' +
                ", gender=" + gender +
                ", age=" + age +
                ", password='" + password + '\'' +
                '}';
    }
}
